import React, { Component } from "react";

export class Maincount extends Component {

  // 事件处理函数
  changeCount = (num) => {
    this.props.changeCount(num);
  }
  render() {
    return (
      <div>
        <button onClick={() => this.changeCount(1)}>+1</button>
        <button onClick={() => this.changeCount(5)}>+5</button>
        <button onClick={() => this.changeCount(10)}>+10</button>
      </div>
    );
  }
}

export default Maincount;
